form {
	display: block;
}

input,
button,
select,
textarea {
	outline: none;
}

textarea {
	resize: none;
	border: none;
	background: none;
}

input {
	background: none;
	user-select: text;
	cursor: auto;
	padding: 0;
	border: 0;
	font-size: @l3;
	-webkit-appearance: textfield;
	-webkit-rtl-ordering: logical;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
// checkbox, radio 默认样式调整
input.is-checkbox {
	box-sizing: border-box;
	-webkit-appearance: none; /*去除默认样式*/
	visibility: hidden;
	cursor: pointer;
	border: none;
	outline: none;
	background: transparent;
	position: relative;
	.flex-wrap-center;
	width: 32px;
	height: 100%;
	&:after {
		display: block;
		width: 16px;
		height: 16px;
		content: ' ';
		visibility: visible;
		.flex-wrap-center;
		background: url('../../image/form/checkbox/unchecked.svg') no-repeat center center;
		background-size: 100% 100%;
	}

	&:checked {
		&:after {
			//content: "✓";
			background-image: url('../../image/form/checkbox/checked.svg');
		}
	}
}
// checkbox 开关样式
input.is-switch {
	width: 50px;
	height: 32px;
	position: relative;
	border: 1px solid #dfdfdf;
	background-color: #fdfdfd;
	box-shadow: #dfdfdf 0 0 0 0 inset;
	border-radius: 30px;
	background-clip: content-box;
	display: inline-block;
	-webkit-appearance: none;
	user-select: none;
	outline: none;

	transition: border cubic-bezier(0, 0, 0, 1) 0.4s, box-shadow cubic-bezier(0, 0, 0, 1) 0.4s;

	&:before {
		content: '';
		width: 30px;
		height: 30px;
		position: absolute;
		top: 0px;
		left: 0;
		border-radius: 30px;
		background-color: #fff;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
	}
	&:checked {
		box-shadow: @btnBgSuccess 0 0 0 16px inset;
		background-color: @btnBgSuccess;
		transition: border ease 0.4s, box-shadow ease 0.4s, background-color ease 1.2s;
		&:before {
			transition: left 0.3s;
			left: 20px;
		}
	}
}

select {
	background: none;
	border: none;
	cursor: auto;
	font-size: @l3;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

// 红色星号
.required-star {
	&:after {
		content: ' ';
		display: inline-block;
		width: 10px;
		height: 10px;
		background: url('../../image/form/required-star.svg') no-repeat center;
		background-size: 60%;
	}
}
label {
	&.required {
		.required-star;
	}
}

.ignoreRequired {
	label {
		&.required {
			&:after {
				display: none;
			}
		}
	}
}

.input-range {
	input[type='date'],
	input[type='number'],
	input[type='text'],
	select {
		display: inline-block;
		width: 120px;
		font-size: @l3;
		.box-line;
	}

	.limit {
		display: inline-block;
		color: @borderColor;
		padding: 0 2px;
	}
}
.input-split {
	display: inline-block;
	color: @borderColor;
	padding: 0 3px;
}

.form-content {
	position: relative;

	.legend {
		.flex-1;
		.padding-h;
		align-items: center;
		line-height: 40px;
		background: @defaultBg;
		color: @infoColor;
	}
	.form-item {
		background: @paneBg;
		position: relative;
		.flex-wrap-v;
		.t-line;
		min-height: 44px;
		padding: 10px;

		&.is-mini {
			min-height: 36px;
		}
		&:last-of-type {
			.tb-line;
		}
		input[type='text'],
		input[type='password'],
		input[type='date'],
		input[type='datetime-local'],
		input[type='number'],
		input[type='tel'],
		textarea {
			.flex-1;
			min-width: 40px; // 兼容安卓低版本手机宽度自适应问题
			padding: 5px;

			&.is-inline {
				background: #f6f6f6;
			}
			&.is-right {
				text-align: right;
			}
		}

		label {
			color: @labelColor;
			font-size: @l3;
			line-height: 24px;
		}

		.item-content {
			.flex-wrap;
			.align-center;
			.flex-1;

			label {
				width: 90px;
			}
		}

		&.disabled {
			color: @linkColorDisabled;
		}
		// dwz-icon 图标
		i {
			font-size: @l2;
		}
		&.dwz-user-icon {
			.item-content {
				justify-content: flex-end;

				img {
					max-width: 66px;
					max-height: 66px;
					border-radius: 50%;
					margin: 5px 15px;
				}
			}
		}
	}

	// 无分隔线
	&.no-line {
		.form-item {
			border: none;
			min-height: 40px;
		}
	}

	// 圆角边框
	&.box-round {
		.margin-h;
		.box-line;
		.form-item {
			&:first-of-type {
				border: none;
			}
			&:last-of-type {
				.t-line;
			}
		}
	}
}

input:invalid,
select:invalid,
textarea:invalid {
	background: url('../../image/icon/icon-invalid.svg') 100% center no-repeat;
}

// input:read-only,
// textarea:read-only {
// 	background-color: @inputBg;
// }
